import request from '@/utils/request'

// 查询公摊用户关联列表
export function listPublicShareJoin(query) {
  return request({
    url: '/datastatistics/publicShareJoin/list',
    method: 'get',
    params: query
  })
}

// 查询公摊用户关联列表
export function listPublicShareJoinAll(query) {
  return request({
    url: '/datastatistics/publicShareJoin/getAll',
    method: 'get',
    params: query
  })
}

// 查询公摊用户关联详细
export function getPublicShareJoin(id) {
  return request({
    url: '/datastatistics/publicShareJoin/' + id,
    method: 'get'
  })
}

// 新增公摊用户关联
export function addPublicShareJoin(data) {
  return request({
    url: '/datastatistics/publicShareJoin',
    method: 'post',
    data: data
  })
}

// 修改公摊用户关联
export function updatePublicShareJoin(data) {
  return request({
    url: '/datastatistics/publicShareJoin',
    method: 'put',
    data: data
  })
}

// 删除公摊用户关联
export function delPublicShareJoin(id) {
  return request({
    url: '/datastatistics/publicShareJoin/' + id,
    method: 'delete'
  })
}

// 批量新增区域绑定的设备
export function addBindUser(data) {
  return request({
    url: '/datastatistics/publicShareJoin/addBindUser',
    method: 'post',
    data: data
  })
}

// 修改区域绑定的设备
export function editBindUser(data) {
  return request({
    url: '/datastatistics/publicShareJoin/editBindUser',
    method: 'put',
    data: data
  })
}

// 查询公摊用户关联列表
export function getUserListInSelect() {
  return request({
    url: '/datastatistics/publicShareJoin/getUserListInSelect',
    method: 'get',
  })
}
// 查询公摊用户关联列表
export function getUserPageForGJ(query) {
  return request({
    url: '/datastatistics/publicShareJoin/getUserPageForGJ',
    method: 'get',
    params: query
  })
}


export function getUserPageForGJProduct(query) {
  return request({
    url: '/datastatistics/publicShareJoin/getUserPageForGJProduct',
    method: 'get',
    params: query
  })
}

// 查询用户挂接表，以及用户下公摊下的其他用户挂接表
export function getUserTerminalInPublicShareList(query) {
  return request({
    url: '/datastatistics/publicShareJoin/getUserTerminalInPublicShareList',
    method: 'get',
    params: query
  })
}

//办理离场
export function dealUserLeave(query) {
  return request({
    url: '/datastatistics/publicShareJoin/dealUserLeave',
    method: 'post',
    data: query
  })
}